A clock signal provides a periodic pulse sequence to a component in a digital circuit, and ensures normal working of the digital circuit. The clock signal may be generated using a clock generation circuit. The clock generation circuit usually includes a clock source, and an oscillation circuit in the clock source is used to generate a periodic pulse used as a clock signal.
To improve reliability of the clock generation circuit, two clock sources such as a primary clock source and a secondary clock source may be arranged in the clock generation circuit. The primary clock source and the secondary clock source each generate a clock signal. A dedicated detection circuit is arranged in the clock generation circuit to detect whether the primary clock source has a failure, and when it is detected that no clock signal is output from the primary clock source, a clock signal from the secondary clock source is output. In the foregoing method, a time period needs to be taken from a time at which the primary clock source stops outputting a clock signal to a time at which the detection circuit detects that the primary clock source stops outputting a clock signal and the secondary clock source is selected. In this time period, the clock generation circuit cannot provide a correct clock signal.
In conclusion, in a current clock generation circuit, a problem that a clock signal output by the clock generation circuit is interrupted when a clock source cannot normally work occurs.